﻿using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Windows.Media.Imaging;

namespace ConstellationShow
{
    public partial class Star : UserControl
    {
        int mm = 5;
        public int mark
        {
            get { return mm; }
            set 
            {
                mm = value;
                SetImg(); 
            }
        }
        public Star()
        {
            // 为初始化变量所必需
            InitializeComponent();
            Loaded += (_, __) =>
            {
                SetImg();
            };
        }

        private void SetImg()
        {
            BitmapImage bi = new BitmapImage(new Uri("/Images/star_02.png", UriKind.Relative));
            BitmapImage bi1 = new BitmapImage(new Uri("/Images/star_01.png", UriKind.Relative));
            s5.Source = s4.Source = s3.Source = s2.Source = s1.Source = bi1;
            if (mm == 1)
                s5.Source = s4.Source = s3.Source = s2.Source = bi;
            else if (mm == 2)
                s5.Source = s4.Source = s3.Source = bi;
            else if (mm == 3)
                s5.Source = s4.Source = bi;
            else if (mm == 4)
                s5.Source = bi;
        }
    }
}